<%-- 
    Document   : tambah_pguna
    Created on : Aug 9, 2012, 10:55:24 AM
    Author     : ubuntu
--%>
<%@ include file="/WEB-INF/jsp/include/page_header.jspf" %>
<%@page contentType="text/html" pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <title>Tambah Pengguna</title>
        <script type="text/javascript">
            $(document).ready(function() {
                $('#tabs').tabs();
                $('form').submit(function(){
                    return formValidation();
                });
            });
            
            function fun(x){
                var text = "";
                if(x.id == "aeroplane")
                    text = "kapal terbang";
                if(x.id == "bicycle")
                    text = "basikal";
                if(x.id == "burger")
                    text = "makanan";
                if(x.id == "guitars")
                    text = "gitar";
                if(x.id == "shoes")
                    text = "kasut";
                if(x.id == "toy")
                    text = "mainan";
                 if(x.id == "quran")
                    text = "Al - Quran";
                if(x.id == "sejadah")
                    text = "Sejadah";
                if(x.id == "dinar")
                    text = "Dinar";
                if(x.id == "rehal")
                    text = "Rehal";
                if(x.id == "tasbih")
                    text = "Tasbih";
                if(x.id == "kompas")
                    text = "Kompas";
                document.getElementById("imid").innerHTML="<b>Imej pilihan anda ialah "+text+"</b>";
                document.getElementById("imgid").value=x.id;
            }
        </script>
    </head>
    <body>        
        <s:messages/>
        <s:errors/> 
        <s:useActionBean beanclass="th.stripes.util.ListUtil" id="listUtil" />
        <s:form beanclass="th.stripes.action.AdminAction" class="niceform">
            <div id="content">
                <div id="logo">
                    <span>
                        <img src="${pageContext.request.contextPath}/images/img/ribbon.png"/>               
                    </span>
                </div>
                <h3>
                    Pendaftaran Pengguna
                </h3>                              
                <p>
                    <label><font color="red">*</font>ID Pengguna</label>
                    <s:text name="pengguna.idPengguna" class="required"/>
                </p>
                <p>
                    <label><font color="red">*</font>Kata Laluan</label>
                        <s:password name="pengguna.password" class="required"/>
                </p>
                <p>
                    <label><font color="red">*</font>Nama</label>
                        <s:text name="pengguna.nama" size="50" class="required"/>
                </p>
                <p>
                    <label><font color="red">*</font>No. KP/No. Pekerja</label>
                    <s:text name="pengguna.noKp" class="required"/>
                </p>
                <p>
                    <label><font color="red">*</font>Jabatan</label>
                        <s:select name="pengguna.jenisPengguna.kod" class="required">
                            <s:option value="">Sila Pilih</s:option>
                        <c:forEach items="${listUtil.senaraiPeranan}" var="item">
                            <c:if test="${item.kod ne '001'}">
                                <s:option value="${item.kod}">${item.kod} - ${item.nama}</s:option>
                            </c:if>
                        </c:forEach>
                    </s:select>
                </p>

                <p>
                    <label>E-mel</label>
                    <s:text name="pengguna.email" size="50"/>
                </p>

                <p>
                    <label><font color="red">*</font>Sila pilih imej untuk id pengguna anda(imej ini akan dipaparkan setiap kali anda log masuk ke e-THiJARI)</label>                    
                <table>
                    <tr>
                        <td><img src="${pageContext.request.contextPath}/images/securityimage/quran.jpg" id="quran" onclick="fun(this)" height="80" width="80" style="cursor: pointer"/></td>
                        <td><img src="${pageContext.request.contextPath}/images/securityimage/sejadah.jpg" id="sejadah" onclick="fun(this)" height="80" width="80" style="cursor: pointer"/></td>
                         <td><img src="${pageContext.request.contextPath}/images/securityimage/dinar.jpg" id="dinar" onclick="fun(this)" height="80" width="80" style="cursor: pointer"/></td>
                    </tr> 
                    <tr>
                         <td><img src="${pageContext.request.contextPath}/images/securityimage/rehal.jpg" id="rehal" onclick="fun(this)" height="80" width="80" style="cursor: pointer"/></td>
                         <td><img src="${pageContext.request.contextPath}/images/securityimage/tasbih.jpg" id="tasbih" onclick="fun(this)" height="80" width="80" style="cursor: pointer"/></td>
                         <td><img src="${pageContext.request.contextPath}/images/securityimage/kompas.jpg" id="kompas" onclick="fun(this)" height="80" width="80" style="cursor: pointer"/></td>
                    </tr>
                     <tr>
                        <td colspan="3"><span id="imid" /></td>
                        <s:hidden name="pengguna.imgid" id="imgid" />
                    </tr>
                </table>
            </p>
            <!--Added in 2/6/15 -->
            <p>
                <label><font color="red">*</font>Frasa Rahsia</label>
                <s:text name="pengguna.secPhrase" maxlength="15" id="secPhrase"/>&nbsp;Contoh : mytahaku
            </p>  
                  
            <p>
                <label>&nbsp;</label>
                <s:submit name="addUser" value="Simpan" class="button green"/>
                <s:reset name="reset" value="Semula" class="button green"/>
            </p>  
            <p>
               <label>&nbsp;</label>
               <font size="2">Semua yang bertanda <font color="red">*</font> adalah Mandatori.</font>
           </p>
        </div>
    </s:form>
</body>
</html>
